<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
	<head>
		<meta charset="UTF-8">
		<link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/css/css/base.css">
		<link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/css/css/style.css">
		<script type="text/javascript" src="${pageContext.request.contextPath}/js/jquery-2.1.4.min.js"></script>
		<title>家政人员管理-全部人员</title>
	</head>
	<body>
		<div class="page">
			<div class="header">
				<div class="header_top"></div>
				<div class="header_bottom clearfix">
					<div class="header_logo fl">
						<img src="${pageContext.request.contextPath}/images/images/index-logo.png">
					</div>
					<ul class="header_nav clearfix fl">
						<li>
							<a href="${pageContext.request.contextPath}/morder/waitOrderList.html">订单管理</a>
						</li>
						<li>
							<a href="${pageContext.request.contextPath}/staff/queryAllList/1.html" class="on">家政人员管理</a>
						</li>
						<li>
							<a href="${pageContext.request.contextPath}/supplier/account.html">财务管理</a>
						</li>
						<li>
							<a href="${pageContext.request.contextPath}/admin/accountInfo.html">账户管理</a>
						</li>
					</ul>
					<div class="header_user fr">
						<img src="${pageContext.request.contextPath}/images/images/user.png">欢迎您，<i>${ sessionScope.MANAGER_NAME} </i><a href="${pageContext.request.contextPath}/manager/loginout.html">【切换账号】</a>
					</div>
				</div>
			</div>
			<div class="main clearfix">
				<div class="main_menu fl">
				
				
					<div class="menu_name on">
						<a href="${pageContext.request.contextPath}/staff/queryAllList/1.html">
							<img src="${pageContext.request.contextPath}/images/images/qbry.png">
							<p>全部人员</p>
						</a>
					</div>
					<div class="menu_name">
						<a href="${pageContext.request.contextPath}/staff/list/1.html">
							<img src="${pageContext.request.contextPath}/images/images/sjry.png">
							<p>上架人员</p>
						</a>
					</div>
					<div class="menu_name add_people">
						<a href="${pageContext.request.contextPath}/staff/add.html">
							<img src="${pageContext.request.contextPath}/images/images/tjry.png">
							<p>添加人员</p>
						</a>
					</div>
					<div class="menu_name screen">
						<a>
							<img src="${pageContext.request.contextPath}/images/images/sxry.png">
							<p>筛选人员</p>
						</a>
					</div>
				</div>
				<div class="main_cont fl">
					<div class="main_cont_top">
						<div class="main_inner clearfix">
							<div class="cont_top_title fl">当前位置：家政人员管理 > 全部人员</div>
							<div class="cont_top_time fr"><i>
							<a href="${pageContext.request.contextPath}/staff/queryAllList/1.html">
							<img src="${pageContext.request.contextPath}/images/images/refresh.png">刷新</a>
							</i></div>
						</div>
					</div>
					<div class="main_cont_top">
						<div class="main_inner clearfix">
							<div class="cont_top_title fl">
								<!-- <button type="button" onclick="xiajia(0);">人员下架</button> -->
								<button type="button" onclick="shanchu();">删除</button>
								<button type="button" onclick="xiajia(1);">人员上架</button>
							</div>
							<div class="cont_top_time fr pr">
								<form action="${pageContext.request.contextPath}/staff/queryAllList/1.html" id="youform">
									<input type="search" placeholder="请输入人员姓名查询" class="search_txt" name="name">
									<input type="submit" value="搜索" class="search pa" style="top:6px;right: 0;">
								</form>
							</div>
						</div>
					</div>
					<div class="main_cont_bottom_qbry">
						<div class="main_inner">
							<table class="table table-border table-bordered table-hover table-bg table-sort">
							    <tr class="text-c"> 
							        <th><input type="checkbox"   class="checked" id="checkAll"></th>
							        <th>头像</th> 
							        <th>人员姓名</th>
							        <th>工种</th>
							        <th>工作状态</th>
							        <th>手机</th>
							        <th>上架状态</th>
							        <th>性别</th> 
							        <th>年龄</th>
							        <th>籍贯</th>
							        <th>学历</th> 
							        <th>评论数</th>
							        <th>更新时间</th>
							        <th>操作</th>
							    </tr> 
							    <c:forEach items="${PAGE_BEAN.dataList}" var="staff">
							    <tr  class="text-c"> 
							        <td><input type="checkbox" name="checkbox"  class="checked" value="${staff.id}"></td>
							        <td>
							        <c:if test="${not empty staff.wSAttacId}">
							        <img src="${pageContext.request.contextPath}/attach/images/${staff.wSAttacId}.jpg" class="stafftx">
							        </c:if>
							        <c:if test="${ empty staff.wSAttacId}"> 
							        <img src="${pageContext.request.contextPath}/images/images/jzrytx.png" class="stafftx">
							        </c:if> 
							        </td> 
							        <td>${staff.wSName}</td>
							        <td>
							        <c:if test="${staff.wSType0==1}">临时保洁 </c:if>
									<c:if test="${staff.wSType1==1}">长期钟点工</c:if>
									<c:if test="${staff.wSType2==1}">住家保姆 </c:if>
									<c:if test="${staff.wSType3==1}">看护老人</c:if>
									<c:if test="${staff.wSType4==1}">育婴师</c:if>
									<c:if test="${staff.wSType5==1}">月嫂</c:if>
									<c:if test="${staff.wSType6==1}">医院护工</c:if>
									<c:if test="${staff.wSType7==1}">开锁换锁</c:if>
									<c:if test="${staff.wSType8==1}">管道疏通</c:if>
									<c:if test="${staff.wSType9==1}">马桶维修</c:if>
									 </td> 
							        <td>
							        <c:if test="${staff.wSWorkerStatus eq 1}">
									在职
									</c:if>
									<c:if test="${staff.wSWorkerStatus eq 0}">
									待岗
									</c:if></td>
							        <td>${staff.wSTelephone}</td>
							        <td>	
							        <c:if test="${staff.status eq 1}">
									已上架
									</c:if>
									<c:if test="${staff.status eq 0}">
									已下架
									</c:if></td>
							        <td>
							         <c:if test="${staff.wSGender eq 1}">
									男
									</c:if>
									<c:if test="${staff.wSGender eq 0}">
									女
									</c:if>
							        </td>
							        <td>${staff.wSAge}</td>
							        <td>${staff.wSNation}</td>
							        <td>${staff.wSEdu}</td>
							        <td>${staff.wSScore}</td>
							        <td> <fmt:formatDate value="${staff.modifiTime}" pattern="yyyy-MM-dd HH:mm:ss"/> </td>
							        <td><button class="ckjl" onClick="details(${staff.id})">查看简历</button></td>
							    </tr>
							    </c:forEach>
							</table> 
							<%@ include file="/WEB-INF/views/page.jsp"%>
						</div>
					</div>
				</div>
			</div>
			
<script type="text/javascript" src="${pageContext.request.contextPath}/lib/My97DatePicker/WdatePicker.js"></script> 
<script type="text/javascript" src="${pageContext.request.contextPath}/lib/datatables/1.10.0/jquery.dataTables.min.js"></script> 
<script type="text/javascript">
$(function(){
	$('.table-sort').dataTable({
		"bLengthChange": false, //改变每页显示数据数量
		"aaSorting": [[ 1, "desc" ]],//默认第几个排序
		"bStateSave": true,//状态保存
		"bPaginate" : false,// 分页按钮  
		"aoColumnDefs": [
		  //{"bVisible": false, "aTargets": [ 3 ]} //控制列的隐藏显示
		  {"orderable":false,"aTargets":[0,2,3]}// 制定列不参与排序
		]
	});
	$('.table-sort tbody').on( 'click', 'tr', function () {
		if ( $(this).hasClass('selected') ) {
			$(this).removeClass('selected');
		}
		else {
			table.$('tr.selected').removeClass('selected');
			$(this).addClass('selected');
		}
	});
	
});
/*渠道-添加*/
function staff_add(title,url,w,h){
	layer_show(title,url,w,h);
}




/*渠道-删除*/
function staff_del(obj,id){
	layer.confirm('确认要删除吗？',function(index){
		$(obj).parents("tr").remove();
		$.ajax(
				{url:"/staff/remove/" + id + ".json",
				async:false,
				success: function(data){
					if(data.status == 'y') {
						layer.msg('已删除!',{icon:1,time:1000});
					} else {
						layer.msg(data.info,{icon:1,time:1000});
					}
				}
		});
	});
}

function details(id){
	window.location = "${pageContext.request.contextPath}/staff/details.html?id="+id;
}

function shanchu(){
	var str="";
	 $("input[name='checkbox']:checked").each(function () {
        str+=this.value+"-";
     });
	 
	 if(str==null || str==""){
		 alert("请选择人员！");
		 return false;
	 }
	 
	 if(window.confirm('你确定要删除人员吗？')){
		 if(str!=""){
			 $.ajax({
				 	url:"/staff/remove.json?ids="+str,
					success: function(data){
						alert(data.info);
						window.location.reload();
					}
				});
		 }
         return true;
      }else{
         return false;
     }
}

function xiajia(flag){
	
	var str="";
	 $("input[name='checkbox']:checked").each(function () {
       str+=this.value+"-";
    });
	 
	 if(str==null || str==""){
		 alert("请选择人员！");
		 return false;
	 }
	 
	 if(str!=""){
		 $.ajax({
			 	url:"/staff/stop.json?ids="+str+"&flag="+flag,
				success: function(data){
					alert(data.info);
					window.location.reload();
				}
			});
	 }

}


    $("#checkAll").bind("click", function () {
    	$("[name=checkbox]:checkbox").prop("checked", this.checked);
    });

	$("input[name='checkbox']").click(function() {
	    var $subs = $("input[name='checkbox']");
		$("#checkAll").prop("checked",$subs.length == $subs.filter(":checked").length ? true : false);
	});



</script> 
			
			<!--筛选人员-->
			<div class="mask_shaixuan">
				<div class="shaixuanrenyuan">
					<img src="${pageContext.request.contextPath}/images/images/close_bai.png" class="close">
					<h3>筛选人员</h3>
					<div class="shaixuan_main">
						<form action="${pageContext.request.contextPath}/staff/queryAllList/1.html" id="myform">
							<div>关键字：<input type="text" placeholder="请输入家政人员姓名查询" class="keywords" name="name"></div>
							<div class="csgz clearfix">
								<p>从事工种：</p>
								<ul class="clearfix" id="type">
									<li class="on">不限 </li>
									<li>临时保洁</li>
									<li>长期钟点工</li>
									<li>育婴师</li>
									<li>月嫂</li>
									<li>保姆</li>
									<li>看护老人</li>
									<li>医院护工</li>
									<li>开锁换锁</li>
									<li>马桶维修</li>
									<li>管道疏通</li>
								</ul>
							</div>
							<div class="gzzt clearfix">
								<p>工作状态：</p>
								<ul class="clearfix" id="workerstatus" >
									<li class="on">不限 </li>
									<li>待岗</li>
									<li>在职</li>
								</ul>
							</div>
							<div class="sjzt clearfix">
								<p>上架状态：</p>
								<ul class="clearfix" id="allstatus">
									<li class="on">不限 </li>
									<li >上架</li>
									<li>下架</li>
								</ul>
							</div>
							<div class="age clearfix" id="age">
								<p>年龄：</p>
								<ul class="clearfix">
									<li class="on">不限 </li>
									<li>30岁以下</li>
									<li>30-35岁</li>
									<li >35-40岁</li>
									<li>40-45岁</li>
									<li>45-50岁</li>
									<li>50岁以上</li>
								</ul>
							</div>
							<div class="education clearfix">
								<p>学历：</p>
								<ul class="clearfix" id="edu">
									<li class="on">不限 </li>
									<li>小学</li>
									<li>初中</li>
									<li>高中</li>
									<li>大专</li>
									<li>本科</li>
								</ul>
							</div>
							<div class="native_place clearfix">
								<p>籍贯：</p>
								<ul class="clearfix" id="place">
									<li class="on">不限 </li>
									<li>上海</li>
									<li>北京</li>
									<li>安徽</li>
									<li>福建</li>
									<li>甘肃</li>
									<li>广东</li>
									<li>广西</li>
									<li>贵州</li>
									<li>海南</li>
									<li>河北</li>
									<li>河南</li>
									<li>黑龙江</li>
									<li>湖北</li>
									<li>湖南</li>
									<li>吉林</li>
									<li>江苏</li>
									<li>江西</li>
									<li>辽宁</li>
									<li>内蒙古</li>
									<li>宁夏</li>
									<li>青海</li>
									<li>山东</li>
									<li>山西</li>
									<li>陕西</li>
									<li>四川</li>
									<li>天津</li>
									<li>西藏</li>
									<li>新疆</li>
									<li>云南</li>
									<li>浙江</li>
									<li >重庆</li>
									<li>香港</li>
									<li>澳门</li>
									<li>台湾</li>                  
								</ul>
							</div>
							<!-- <div class="salary clearfix mb25">
								<p>期望工资：</p>
								<ul class="clearfix">
									<li class="on">不限 </li>
									<li>3000以下</li>
									<li>3001-4000</li>
									<li>4001-6000</li>
									<li>6001-8000</li>
									<li>8001-10000</li>
									<li>1万以上</li>
								</ul>
							</div> -->
							
							<input type="hidden" name="wSType0" id="t0"  value="0" />
							<input type="hidden" name="wSType1" id="t1"  value="0" />
							<input type="hidden" name="wSType2" id="t2"  value="0" />
							<input type="hidden" name="wSType3" id="t3"  value="0" />
							<input type="hidden" name="wSType4" id="t4"  value="0" />
							<input type="hidden" name="wSType5" id="t5"  value="0" />
							<input type="hidden" name="wSType6" id="t6"  value="0" />
							<input type="hidden" name="wSType7" id="t7"  value="0" />
							<input type="hidden" name="wSType8" id="t8"  value="0" />
							<input type="hidden" name="wSType9" id="t9"  value="0" />
							
							<input type="hidden" name="wSWorkerStatus" id="wSWorkerStatus"/>
							<input type="hidden" name="status" id="status" />
							<input type="hidden" name="bigwSAge" id="bigwSAge"/>
							<input type="hidden" name="smallwSAge" id="smallwSAge"/>
							<input type="hidden" name="wSEdu" id="wSEdu"/>
							<input type="hidden" name="wSNation" id="wSNation"/>
							<input type="submit" value="确定筛选" class="shaixuan_sure" >
						</form>
					</div>
				</div>
			</div>
		</div>
		<script>
			$(".screen").on("click",function(){
				$(".mask_shaixuan").show();
			});
			$(".close").on("click",function(){
				$(".mask_shaixuan").hide();
			});
			$(".csgz li").click(function(){
				$(".csgz li").removeClass("on");
				$(this).addClass("on").siblings().removeClass("on");
			});
			$(".gzzt li").click(function(){
				$(".gzzt li").removeClass("on");
				$(this).addClass("on").siblings().removeClass("on");
			});
			$(".sjzt li").click(function(){
				$(".sjzt li").removeClass("on");
				$(this).addClass("on").siblings().removeClass("on");
			});
			$(".age li").click(function(){
				$(".age li").removeClass("on");
				$(this).addClass("on").siblings().removeClass("on");
			});
			$(".education li").click(function(){
				$(".education li").removeClass("on");
				$(this).addClass("on").siblings().removeClass("on");
			});
			$(".native_place li").click(function(){
				$(".native_place li").removeClass("on");
				$(this).addClass("on").siblings().removeClass("on");
			});
			$(".salary li").click(function(){
				$(".salary li").removeClass("on");
				$(this).addClass("on").siblings().removeClass("on");
			});
			
			
				var obj_lis=$("#edu").find("li");
				obj_lis.click(function() {
						$("#wSEdu").val(this.innerHTML);
				});
				
				var obj_lis=$("#place").find("li");
				obj_lis.click(function() {
						$("#wSNation").val(this.innerHTML);
				});
				
				var obj_lis=$("#allstatus").find("li");
				obj_lis.click(function() {
	                if(this.innerHTML=="上架"){
	                	$("#status").val(1);
	                }
	                if(this.innerHTML=="下架"){
	                	$("#status").val(10);
	                } 
				});
				
				var obj_lis=$("#workerstatus").find("li");
				obj_lis.click(function() {
	                if(this.innerHTML=="在职"){
	                	$("#wSWorkerStatus").val(1);
	                }
	                if(this.innerHTML=="待岗"){
	                	$("#wSWorkerStatus").val(8);
	                } 
	                //alert(this.innerHTML+$("#wSWorkerStatus").val());
				});
				
				var obj_lis=$("#age").find("li");
				obj_lis.click(function() {
	                if(this.innerHTML=="30岁以下"){
	                	$("#bigwSAge").val(30);
	                }
	                if(this.innerHTML=="30-35岁"){
	                	$("#smallwSAge").val(30);
	                	$("#bigwSAge").val(35);
	                } 
	                if(this.innerHTML=="35-40岁"){
	                	$("#smallwSAge").val(35);
	                	$("#bigwSAge").val(40);
	                } 
	                if(this.innerHTML=="40-45岁"){
	                	$("#smallwSAge").val(40);
	                	$("#bigwSAge").val(45);
	                }
	                if(this.innerHTML=="45-50岁"){
	                	$("#smallwSAge").val(45);
	                	$("#bigwSAge").val(50);
	                }
	                if(this.innerHTML=="50岁以上"){
	                	$("#smallwSAge").val(50);
	                }
				});
				
				
				
				var obj_lis=$("#type").find("li");
				obj_lis.click(function() {
	                if(this.innerHTML=="临时保洁"){
				 		$("#t0").val(1);
	                }else{
	                	$("#t0").val(0);
	                }
	                if(this.innerHTML=="长期钟点工"){
	                	$("#t1").val(1);
	                } 
	                else{
	                	$("#t1").val(0);
	                }
	                if(this.innerHTML=="住家保姆"){
	                	$("#t2").val(1);
	                } 
	                else{
	                	$("#t2").val(0);
	                }
	                if(this.innerHTML=="看护老人"){
	                	$("#t3").val(1);
	                } 
	                else{
	                	$("#t3").val(0);
	                } 
	                if(this.innerHTML=="育婴师"){
	                	$("#t4").val(1);
	                } 
	                else{
	                	$("#t4").val(0);
	                }
	                if(this.innerHTML=="月嫂"){
	                	$("#t5").val(1);
	                } 
	                else{
	                	$("#t5").val(0);
	                } 
	                if(this.innerHTML=="医院护工"){
	                	$("#t6").val(1);
	                } 
	                else{
	                	$("#t6").val(0);
	                } 
	                if(this.innerHTML=="开锁换锁 "){
	                	$("#t7").val(1);
	                } 
	                else{
	                	$("#t7").val(0);
	                } 
	                if(this.innerHTML=="管道疏通"){
	                	$("#t8").val(1);
	                } 
	                else{
	                	$("#t8").val(0);
	                } 
	                if(this.innerHTML=="马桶维修"){
	                	$("#t9").val(1);
	                } 
	                else{
	                	$("#t9").val(0);
	                }
	                
				});
				
	
			
			
			
		</script>
	</body>
</html>
